package com.example.gzysmartcity.ui.adapter;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.gzysmartcity.R;
import com.example.gzysmartcity.repository.model.Reserve;

import org.jetbrains.annotations.NotNull;

public class DoctorAdapter extends BaseQuickAdapter<Reserve, BaseViewHolder> {
    public DoctorAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, Reserve reserve) {
        baseViewHolder.setText(R.id.tv_doctor_name,reserve.getDataBean().getName());
        baseViewHolder.setText(R.id.tv_doctor_content,reserve.getDataBean().getAdept());
        RecyclerView recyclerView=baseViewHolder.getView(R.id.rv_doctor_item);
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        DoctorTimeRvAdpater adpater=new DoctorTimeRvAdpater(R.layout.rv_doctor_time);
        adpater.setNewInstance(reserve.getDatelist());
        recyclerView.setAdapter(adpater);
    }
}
